<template>
	<view id="app">
		<view class="homeTop"></view>
		<uv-navbar title="我的" :border="false" titleStyle="color:#fff;" placeholder bg-color="rgba(0,0,0,0)">
			<template slot="left"></template>
		</uv-navbar>
		<view class="container pr zi10">
			<view class="df pl20 w100p aic">
				<view class="f1 df w100p">
					<view class="wh140 mr20">
						<uv-avatar :src="userinfo.avatar" size="140rpx"></uv-avatar>
					</view>
					<viwe class="f1 df fdc">
						<view class="cw f36 fw5 ptb20">{{userinfo.nickname}}</view>
					</viwe>
				</view>
				<view class="w100" @click="handle('personal')">
					<uv-icon name="edit-pen" color="#fff" size="60rpx"></uv-icon>
				</view>
			</view>
		</view>
		<view class="container pr zi10">
			<view class="mt30  bgw br15 pr zi100 w100p df fdc pt30">
				<view class="df w100p mb30">
					<view class="f1 df ver">
						<uv-icon name="order" size="60rpx" color="#000"></uv-icon>
						<view class="ptb15 f28 c000">全部订单</view>
					</view>
					<view class="f1 df ver pr">
						<uv-icon name="clock" size="60rpx" color="#000">
						</uv-icon>
						<view class="ptb15 f28 c000">待接单</view>
						<view class="pa badgey">
							<uv-badge type="error" max="99" :value="2"></uv-badge>
						</view>
					</view>
					<view class="f1 df ver pr">
						<uv-icon name="more-circle" size="60rpx" color="#000"></uv-icon>
						<view class="ptb15 f28 c000">待评价</view>
						<view class="pa badgey">
							<uv-badge :isDot="true" type="error"></uv-badge>
						</view>
					</view>
					<view class="f1 df ver">
						<uv-icon name="checkmark-circle"  size="60rpx" color="#000"></uv-icon>
						<view class="ptb15 f28 c000">已完成</view>
					</view>
				</view>
			</view>
		</view>
		<view class="container pr zi10">
			<view class=" bgw  pr zi100 w100p df fdc">
				<view class="f30 ptb30 c000 plr20 mb20">我的服务</view>
				<view class="df w100p mb30">
					<view class="f1 df ver pr">
						<uv-icon name="star" size="50rpx" color="#666"></uv-icon>
						<view class="ptb15 f28 c666">我的收藏</view>
					</view>
					<view class="f1 df ver">
						<uv-icon name="xiaoxi" custom-prefix="custom-icon" size="50rpx" color="#666"></uv-icon>
						<view class="ptb15 f28 c666">我的消息</view>
					</view>
					<view class="f1 df ver pr">
						<uv-icon name="setting" size="50rpx" color="#666">
						</uv-icon>
						<view class="ptb15 f28 c666">修改资料</view>
					</view>
					<view class="f1 df ver pr">
						<uv-icon name="kefu1" custom-prefix="custom-icon" size="50rpx" color="#666"></uv-icon>
						<view class="ptb15 f28 c666">平台客服</view>
					</view>
				</view>
				<view class="df w100p mb30">
					<view class="df ver plr30">
						<uv-icon name="subtitle_unblock_light" custom-prefix="custom-icon" size="50rpx" color="#666"></uv-icon>
						<view class="ptb15 f28 c666">帮助中心</view>
					</view>
					
					
				</view>
			</view>
		</view>
		<uv-tabbar :value="3" iconSize="50rpx" activeColor="#FFAC3E" inactiveColor="#9ea09f" zIndex="1000">
			<uv-tabbar-item text="首页" @click="reLaunch()">
				<template v-slot:active-icon>
					<image class="wh50" :src="uselected"></image>
				</template>
				<template v-slot:inactive-icon>
					<image class="wh50" :src="uselecte"></image>
				</template>
			</uv-tabbar-item>
			<uv-tabbar-item text="找工匠" @click="redirect('user/cate/cate')">
				<template v-slot:active-icon>
					<image class="wh50" :src="ugjd"></image>
				</template>
				<template v-slot:inactive-icon>
					<image class="wh50" :src="ugj"></image>
				</template>
			</uv-tabbar-item>
			<uv-tabbar-item text="消息" icon="chat" @click="redirect('user/message/message')"></uv-tabbar-item>
			<uv-tabbar-item text="我的" icon="account"></uv-tabbar-item>
		</uv-tabbar>
	</view>
	</view>

</template>

<script>
	export default {
		data() {
			return {
				uselected:this.util.config.host+'/static/images/uhomed.png',
				uselecte:this.util.config.host+'/static/images/home.png',
				ugjd:this.util.config.host+'/static/images/gjd.png',
				ugj:this.util.config.host+'/static/images/gj.png',
				is_login: 0,
				userinfo: {
					id: 0,
					nickname: '未登录',
					avatar: this.util.config.host + '/static/images/logo.jpg',
				},
			}
		},
		onLoad() {
		},
		onShow() {

		},
		methods: {
			handle(e){
				uni.navigateTo({
					url:'/pages/'+e
				});		
			},
			redirect:function(e,isLogin=false){
				if(isLogin == true){
					if(!uni.getStorageSync('QLXG_token')){
						uni.navigateTo({
							url:"/pages/user/index/login"
						})
						return false;
					}
				}
				uni.redirectTo({
					url:"/pages/"+e,
				})
			},
			reLaunch:function(){
				uni.reLaunch({
					url:"/pages/index/index",
				})
			}
		}
	}
</script>

<style scoped>
	.homeTop {
		position: fixed;
		width: 750rpx;
		height: 460rpx;
		z-index: 1;
		background: linear-gradient(127deg,#fe7235 0%,#faad21 70%,#faad21 100%)
	}
	.badgey {
		top: 8rpx;
		right: 45rpx;
	}
	.brcustomer {
		border-radius: 30rpx 0 15rpx 0;
	}
</style>